home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_elevgear.cog < prev    next >
Text File  |  1999-11-15  |  19KB  |  720 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_ElevGear.cog
  4. #
  5. # [TL] [GGJ]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        activated
  13. message        startup
  14. message        entered
  15. message        exited
  16. message        arrived
  17. message        taken
  18. message        damaged
  19.  
  20. thing        player                                    local
  21. thing        weight
  22. thing        elev
  23. thing        gear
  24. thing        block
  25. thing        turtle
  26. thing        eyebutton0
  27. thing        eyebutton1
  28. thing        eyebutton2
  29. thing        charger            mask=0x8
  30. thing        part4
  31. thing        bridge
  32. thing        trapdoor
  33. thing        cam0    
  34. thing        cam1
  35. thing        strut
  36. thing        button            mask=0x8
  37. thing        swingCam
  38. thing        swingGhost
  39. thing        fallCam
  40. thing        fallGhost
  41. thing        buttonCam
  42. thing        bridgeCam
  43. thing        elevCam
  44. thing        buttonActor
  45. thing        weightActor
  46. thing        gearActor
  47. thing        gearCam
  48. thing        gearTarg
  49. thing        elevtarg
  50. thing        fallActor                                local
  51. thing        openingGhost
  52.  
  53. cog            hint
  54.  
  55. sector        gateSect
  56. sector        topsector        mask=0x084
  57. sector        blockoffSector    mask=0x084
  58. sector        weightSector
  59.  
  60. template    actortpl=indy_sh_actor                    local
  61. keyframe    fallKey=in_die_fall.key                    local
  62. keyframe    unlock=in_activate_medium.key            local
  63. keyframe    kneel=0in_stand6.key                       local
  64. keyframe    kneelDown=0in_stand1_bd_6.key                  local
  65. keyframe    standUp=0in_stand6_bd_1.key                   local
  66.  
  67. material    animmat=rigear.mat                        local
  68. material    eyemat=nub_button_frontb.mat            local
  69. flex        fps=8.0                                    local
  70.  
  71. sound        gearplaced=nub_anubisarm_place_c.wav    local
  72. sound        need=INXJ060.WAV                        local    #I don't think that's the right answer
  73. sound        fits=INXJ109.WAV                        local    #It fits!
  74. #Below line removed per Hal 7/27
  75. #sound        concealed=INXJ124.WAV                    local    #I bet they used a concealed weight to power that thing.
  76. sound        stuck=INXJ098.WAV                        local    #It won't budge.
  77. sound        missing=INXJ093.WAV                        local    #Good idea, but not good enough.
  78. sound        charging=nub_aethlight_on_c.wav            local
  79. sound        fallSnd=inxj015.wav                        local    #Aaaaaaaah....  (falling)
  80. sound        partSnd=nb06j02.wav                        local    #INXJ200.wav
  81. sound        partMus=mus_gen_machinepart.wav            local
  82. sound        swingAMus=mus_gen_indy_B_motif1.wav        local
  83. sound        swingBMus=mus_gen_awechord1.wav            local
  84. sound        powered=pr09j04.wav                        local    #There!  Now I've got power to spare
  85. sound        nope0=INXJ092.wav                        local    #Hmmm.  That didn't quite work.
  86. sound        nope1=INXJ088.wav                        local    #Nope.
  87. sound        nope2=inxj269.wav                        local    #Hmmm.
  88. sound        bridgeSlideSnd=bab_door_metal_slide_c.wav    local
  89. sound        bridgeStopSnd=bab_door_metal_stop.wav    local
  90. sound        chargedSnd=vol_elevator_move.wav        local
  91. sound        grateSnd=nub_trapdoor_fall_c.wav        local
  92. sound        buttonSnd=shs_gear_clunk2.wav            local
  93.  
  94. surface        elevface                                mask=0x480
  95. surface        elevfacebott                            mask=0x080
  96.  
  97. vector        v_targetpos                                local
  98.  
  99. int            placed=0                                local
  100. int            tracknum0                                local
  101. int            tracknum1                                local
  102. int            tracknum2                                local
  103. int            tracknum3                                local
  104. int            tracknum4                                local
  105. int            tracknum5                                local
  106. int            tracknum6                                local
  107. int            tracknum7                                local
  108. int            block0=0                                local
  109. int            charged=0                                local
  110. int            going0=0                                local
  111. int            done0=0                                    local
  112. int            done1=0                                    local
  113. int            block1=0                                local
  114. int            needplayed=0                            local
  115. int            stuckplayed=0                            local
  116. int            budgeplayed=0                            local
  117. int            powerplayed=0                            local
  118. int            trapopen=0                                local
  119. int            curcam                                    local
  120. int            blockPos=0                                local
  121. int            blockColl                                local
  122. int            jumping=0                                local
  123. int            kneeltrack                                local
  124. int            bridgemoving=0                            local
  125.  
  126. #sound        blocked0=nub_weight_stop_c.wav            local
  127. #thing        trapcharger
  128. #keyframe     crawl
  129.  
  130. end
  131.  
  132. # ========================================================================================
  133. code
  134.  
  135. startup:
  136.  
  137. player = GetLocalPlayerThing();
  138. blockColl = GetCollideType(block);
  139.  
  140. AttachThingToThing(gear, turtle);
  141. AttachThingToThing(turtle, elev);
  142. MoveToFrame(weight, 1, 10.0);
  143. blockPos=1;
  144. MoveToFrame(elev, 1, 10.0);
  145.  
  146. ClearAdjoinFlags(elevface, 2);
  147. SetThingFlags(gear, 0x80000);
  148. SetCollideType(elev, 0);
  149. ClearPhysicsFlags(part4, 0x1);            #prevent it from falling through tower when tower collision removed
  150.  
  151. return;
  152.  
  153. # ........................................................................................
  154. activated:
  155. if (GetSenderRef() == charger)
  156. {
  157.     PlayVoice(player, nope0[randbetween(0, 2)], 1.0, 1);
  158.     return;
  159. }
  160.  
  161. # if player activates turtle WITHOUT gear in hand
  162. if ((GetSenderRef() == turtle) && (GetCurItem(player) != 67))
  163.     {
  164.     if (needplayed == 1) return;
  165.     if (placed == 1) return;
  166.     needplayed = 1;
  167.     PlayMode(player, 60, 1);
  168.     PlayVoice(player, need, 1.0, 1);
  169.     needplayed = 0;
  170.     }
  171. # if player activates turtle WITH gear in hand
  172. if ((GetSenderRef() == turtle) && (GetCurItem(player) == 67))
  173.     {
  174.         if (placed == 1) return;
  175.         placed = 1;
  176.         MakeMeStop();
  177.         DeselectWeaponWait(player);
  178.         StartCutscene(1);
  179.         CopyPlayerHolsters(player, gearActor);
  180.         
  181.         SetCameraLookInterp(2, 0);
  182.         SetCameraPosInterp(2, 0);
  183.         Sleep(0.01);
  184.         
  185.         SetThingFlags(player, 0x80000);
  186.         ClearThingFlags(gearActor, 0x80000);
  187.         AISetCutsceneMode(gearActor);
  188.         ResetThing(player);
  189.         
  190.         SetCameraFocus(2, gearCam);
  191.         SetCameraSecondaryFocus(2, gearTarg);
  192.         SetCurrentCamera(2);
  193.         SetCameraFOV(90, 0, 0.0);
  194.         PlayKey(gearActor, kneelDown, 2, 0x12, 1);
  195.         
  196.         kneelTrack = PlayKey(gearActor, kneel, 2, 0x14, 0);
  197.         
  198.         Sleep(0.5);
  199.         
  200.         ClearThingFlags(gear, 0x80000);
  201.         PlaySoundLocal(gearplaced, 1.0, 0, 0x0000, 1);
  202.         ChangeInv(player, 67, -1);
  203.         PlayVoice(gearActor, fits, 1.0, 0);
  204.         StopKey(gearActor, kneelTrack, 0.0);            # no longer kneeling
  205.         PlayKey(gearActor, standUp, 2, 0x12, 1);        # indy stands up
  206.         
  207.         CopyOrientandPos(gearActor, player);
  208.         SetThingFlags(gearActor, 0x80000);
  209.         ClearThingFlags(player, 0x80000);
  210.         ClearActorFlags(player, 0x200000);
  211.         
  212.         SetCameraPosition(1, GetThingPos(gearCam));
  213.         SetCurrentCamera(1);
  214.         EndCutscene();
  215.     }
  216. # elevator button code for going up and down
  217. if ((GetSenderRef() == eyebutton1) && (charged == 0))
  218. {
  219.     MakeMeStop();
  220.     DeselectWeaponWait(player);
  221.     StartCutscene(1);
  222.     CopyPlayerHolsters(player, buttonactor);
  223.     SetThingFlags(player, 0x80000);
  224.     ClearThingFlags(buttonActor, 0x80000);
  225.     ResetThing(player);
  226.     CopyOrientandPos(buttonActor, player);
  227.     
  228.     SetCameraFocus(2, elevCam);
  229.     SetCameraSecondaryFocus(2, elevTarg);
  230.     SetCurrentCamera(2);
  231.     PlayKey(buttonActor, unlock, 4, 0x12, 0);
  232.     Sleep(0.5);
  233.     PlayVoice(buttonActor, stuck, 1.0, 0);
  234.     
  235.     Sleep(0.5);
  236.     ClearActorFlags(player, 0x200000);
  237.     SetThingFlags(buttonActor, 0x80000);
  238.     ClearThingFlags(player, 0x80000);
  239.     
  240.     SetCameraPosition(1, GetThingPos(elevCam));
  241.     SetCurrentCamera(1);
  242.     EndCutscene();
  243.     
  244. }
  245. if ((GetSenderRef() == eyebutton0) && (charged == 0))
  246.     {
  247.     PlayVoice(player, nope0[randbetween(0, 2)], 1.0, 1);
  248.     PlayMode(player, 60, 0);
  249.     }
  250. if ((GetSenderRef() == eyebutton0) && (charged == 1) && (trapopen == 1))
  251. {
  252.     if (going0 == 1) return;
  253.     SetCollideType(block, 0);
  254.     MakeMeStop();
  255.     DeselectWeaponWait(player);
  256.     StartCutscene(1);
  257.     PlaySoundThing(buttonSnd, eyebutton0, 1.0, -1, -1, 0);
  258.     PlayMode(player, 60, 1);
  259.     MoveToFrame(weight, 2, 2.8);
  260.     blockPos = 1;
  261.     MoveToFrame(elev, 2, 3.0);
  262.     tracknum5=MaterialAnim(animmat, fps, 1);
  263.     going0 = 1;
  264. }
  265. if ((GetSenderRef() == eyebutton1) && (charged == 1))
  266. {
  267.     if (going0 == 1) return;
  268.     SetCollideType(block, 0);
  269.     MakeMeStop();
  270.     DeselectWeaponWait(player);
  271.     StartCutscene(1);
  272.     PlaySoundThing(buttonSnd, eyebutton0, 1.0, -1, -1, 0);
  273.     PlayMode(player, 60, 1);
  274.     MoveToFrame(weight, 0, 4.5);
  275.     blockPos = 0;
  276.     MoveToFrame(elev, 0, 3.0);
  277.     tracknum6=MaterialAnim(animmat, fps, 1);
  278.     going0 = 1;
  279. }
  280. if ((GetSenderRef() == eyebutton2) && (charged == 1))
  281. {
  282.     if (going0 == 1) return;
  283.     SetCollideType(block, 0);
  284.     MakeMeStop();
  285.     DeselectWeaponWait(player);
  286.     StartCutscene(1);
  287.     PlaySoundThing(buttonSnd, eyebutton0, 1.0, -1, -1, 0);
  288.     PlayMode(player, 60, 1);
  289.     MoveToFrame(weight, 1, 0.9);
  290.     blockPos = 1;
  291.     MoveToFrame(elev, 1, 3.0);
  292.     tracknum7=MaterialAnim(animmat, fps, 1);
  293.     going0 = 1;
  294. }
  295.  
  296. return;
  297.  
  298. # ........................................................................................
  299. entered:
  300. Print("entered");
  301. Print("GetSenderRef is");
  302. Printint(GetSenderRef());
  303. Print("elevfacebott is");
  304. PrintInt(elevfacebott);
  305.  
  306.  
  307. Print("GetSourceRef is");
  308. Printint(GetSourceRef());
  309. Print("Block is");
  310. PrintInt(block);
  311. Print("player is");
  312. PrintInt(player);
  313.  
  314.  
  315. if ((GetSenderRef() == elev) && (jumping == 1) && (charged == 0))
  316. {
  317.     PlayVoice(player, stuck, 1.0, 0);
  318. }
  319. if (GetSenderRef() == GateSect)
  320. {
  321.     jumping = 0;
  322. }
  323.  
  324. # if player lands on weight WITH block placed AND gear placed
  325. if ((GetSourceRef() == player) && (GetSenderRef() == weight) && (placed == 1) && (block0 == 1))
  326. {
  327.     #Sleep(2.0);
  328.     SetCollideType(block, 0);
  329.     AttachThingToThing(block, elev);
  330.     MoveToFrame(weight, 1, 7.5);
  331.     blockPos = 1;
  332.     MoveToFrame(elev, 1, 5.0);
  333.     tracknum0=MaterialAnim(animmat, fps, 1);
  334. }
  335. # if block is pushed onto elevator and gear is NOT placed
  336. if ((GetSourceRef() == block) && (GetSenderRef() == elevface) && (placed == 0))
  337.     {
  338.     PlayVoice(player, stuck, 1.0, 1);
  339.     PlayVoice(player, missing, 1.0, 1);
  340.     }
  341.  
  342. # if player steps on elevator WITH gear placed
  343. if ((GetSourceRef() == player) && (GetSenderRef() == elevface) && (placed == 1))
  344.     {
  345.     #print("It needs more weight...");
  346.     }
  347. # if block is pushed onto elevator WITH gear placed
  348. if ((GetSourceRef() == block) && (GetSenderRef() == elevface) && (placed == 1))
  349. {
  350.     block0 = 1;
  351.     SetAdjoinFlags(elevface, 2);
  352.     SetCollideType(elev, 3);
  353.     SetCollideType(block, 0);
  354.     AttachThingToThing(block, elev);
  355.     MoveToFrame(weight, 0, 7.5);
  356.     blockPos = 0;
  357.     MoveToFrame(elev, 0, 5.0);
  358.     
  359.     MakeMeStop();
  360.     DeselectWeaponWait(player);
  361.     CopyPlayerHolsters(player, weightActor);
  362.     StartCutscene(1);
  363.  
  364.     SetCameraLookInterp(2, 0);
  365.     SetCameraPosInterp(2, 0);
  366.  
  367.     Sleep(1.5);
  368.     SendMessage(hint, user5);
  369.  
  370.     SetThingFlags(player, 0x80000);
  371.     ClearThingFlags(weightActor, 0x80000);
  372.     ResetThing(player);
  373.     
  374.     SetCameraFocus(2, cam0);
  375.     SetCameraSecondaryFocus(2, openingGhost);
  376.     SetCurrentCamera(2);
  377.     return;
  378. }
  379. if ((GetSenderRef() == topSector) && (GetSourceRef() == weight) && (placed == 1) && (done0 == 0))
  380. {
  381.     SetCameraSecondaryFocus(2, weight);
  382.         
  383.     Sleep(0.5);
  384.  
  385.     AIEnableHeadTracking(weightActor, weight);
  386.     AISetLookThing(weightActor, weight);
  387.     CopyOrientandPos(weightActor, player);
  388.     
  389.     #Would be nice to have him say "Aha!"
  390.     
  391.     Sleep(2.5);
  392.     
  393.     # revert cam  (pos x is from right, neg x is from left)
  394.     v_targetpos = VectorAdd(VectorTransformToOrient(player, '-0.2 -0.05 0.0'), GetThingPos(player));    
  395.     SetCameraPosition(1, v_targetpos);
  396.  
  397.     SetCurrentCamera(1);
  398.     ResetCameraFOV(0, 0.0);
  399.     ClearThingFlags(player, 0x80000);
  400.     SetThingFlags(weightActor, 0x80000);
  401.     ClearActorFlags(player, 0x200000);
  402.  
  403.     EndCutScene();
  404.     tracknum2=MaterialAnim(animmat, fps, 1);
  405.     done0 = 1;
  406.     return;
  407. }
  408. # if block is pulled OFF of elevator at the bottom
  409. if (((GetSenderRef() == elevfacebott) || (GetSenderRef() == blockOffSector)) && (GetSourceRef() == block))
  410. {
  411.     SendMessage(hint, user7);
  412.     if (charged == 1) return;
  413.     if (block1 == 1) return;
  414.     SetCollideType(elev, 0);
  415.     print("Taking the block off raised the elevator...");
  416.     block1 = 1;
  417.     Sleep(0.75);
  418.     MoveToFrame(weight, 1, 7.5);
  419.     blockPos = 1;
  420.     MoveToFrame(elev, 1, 5.0);
  421.     Sleep(1.5);
  422.  
  423.     StartCutscene(1);
  424.     curcam = GetCurrentCamera();
  425.     StopThing(player);
  426.     SetActorFlags(player, 0x200000);
  427.     PlayMode(player, 1, 0);
  428.     
  429.     SetCurrentCamera(2);
  430.     SetCameraFocus(2, cam1);
  431.     SetCameraSecondaryFocus(2, weight);
  432.     Sleep(7.0);
  433.  
  434.     SetCurrentCamera(curcam);
  435.     SetCameraFocus(curcam, player);
  436.     SetCameraFOV(90, 0, 0.0);
  437.     ClearActorFlags(player, 0x200000);
  438.     EndCutScene();
  439.     tracknum3=MaterialAnim(animmat, fps, 1);
  440.     return;
  441. }
  442.  
  443. return;
  444.  
  445. # ........................................................................................
  446. exited:
  447. Print("exited");
  448. Print("cur frame of weight =");
  449. PrintInt(GetCurframe(weight));
  450.  
  451. Print("sourceRef =");
  452. PrintInt(getsourceref());
  453. Print("player =");
  454. PrintInt(player);
  455.  
  456.  
  457. Print("senderRef =");
  458. PrintInt(getsenderref());
  459. Print("weightsector = ");
  460. PrintInt(weightsector);
  461.  
  462.  
  463. if ((GetSenderRef() == elev) && (block0 == 1))
  464. {
  465.     jumping = 1;
  466. }
  467.  
  468. #if (block0 == 0) return;
  469. #if (block1 == 1) return;
  470.  
  471. # if player jumps OFF of weight when at BOTTOM AND gear placed
  472. if ((GetSourceRef() == player) && (GetSenderRef() == weightSector) && (GetCurFrame(weight) == 1))
  473. {
  474.     PlaySoundThing(gearplaced, weight, 1.0, -1, -1, 0);
  475.     Sleep(0.5);
  476.     SetCollideType(block, 0);
  477.     AttachThingToThing(block, elev);
  478.     MoveToFrame(weight, 0, 7.5);
  479.     blockPos = 0;
  480.     MoveToFrame(elev, 0, 5.0);
  481.     tracknum1=MaterialAnim(animmat, fps, 1);
  482. }
  483.  
  484. return;
  485.  
  486. # ........................................................................................
  487. arrived:
  488. PRINT("arrived");    
  489. if (GetSenderRef() == bridge)
  490. {
  491.     PlaySoundThing(bridgeStopSnd, bridge, 1.0, 20, 50, 0);
  492.     Sleep(1.0);
  493.     bridgemoving = 0;
  494.     return;
  495. }
  496.  
  497. if ((GetSenderRef() == weight) && (block0 == 1))
  498. {
  499.     Print("at bottom");
  500.     #ResetThing(player);
  501.     ClearActorFlags(player, 0x200000);
  502.     EndCutscene();
  503.     return;
  504. }
  505. if (GetSenderRef() == elev)
  506. {
  507.     SetCollideType(block, blockColl);
  508.     StopAnim(tracknum0);
  509.     StopAnim(tracknum1);
  510.     StopAnim(tracknum2);
  511.     StopAnim(tracknum3);
  512.     StopAnim(tracknum4);
  513.     StopAnim(tracknum5);
  514.     StopAnim(tracknum6);
  515.     StopAnim(tracknum7);
  516.     going0 = 0;
  517.     if ((GetCurFrame(elev) == 0) && (block0 == 1) && (charged == 0))
  518.     {
  519.         SetCollideType(block, 3);                         #blockcoll);            
  520.         DetachThing(block);
  521.     }
  522.     if (charged == 1)
  523.     {
  524.         ClearActorFlags(player);
  525.         EndCutscene();
  526.     }
  527. }
  528.  
  529. return;
  530.  
  531. # ........................................................................................
  532. taken:
  533.  
  534. if (GetSenderRef() == part4)
  535. {
  536.     StartCutscene(1);
  537.     SetActorFlags(player, 0x200000);
  538.     StopThing(player);
  539.     
  540.     #Bring the camera around
  541. #    SetExtCamLookOffset('0.0 0.04 0.014');
  542. #    SetExtCamOffset('0.15 0.08 0.09');
  543.  
  544.     #SetExtCamOffset('-0.1 0.05 0.07');
  545.     PlaySoundLocal(partMus, 1.0, 0.0, 0x0, 0);
  546.     PlayVoice(player, partSnd, 1.0, 0);
  547.     Sleep(4.5);
  548. #    RestoreExtCam();
  549.     ClearActorFlags(player, 0x200000);
  550.     EndCutscene();
  551. }
  552.  
  553. return;
  554.  
  555. # ........................................................................................
  556. damaged:
  557. Print("damaged");
  558.  
  559. # if player activates charger WITH IMP #4 and elevator is up
  560. if ((GetSenderRef() == charger) && (GetCurFrame(elev) == 1) && (GetParam(1) == 0x4000))
  561.     {
  562.     Print("charging elevator");
  563.     if (charged == 1) return;
  564.     charged = 1;
  565.     SetCollideType(elev, 3);
  566.     //PlayMode(player, 60, 1);
  567.     PlaySoundThing(charging, eyebutton0, 1.0, -1, -1, 0);
  568.     SetMaterialCel(eyemat, 1);
  569.     MoveToFrame(weight, 0, 7.5);
  570.     blockPos = 0;
  571.     MoveToFrame(elev, 0, 5.0);
  572.     tracknum4=MaterialAnim(animmat, fps, 1);
  573.     SetThingLight(eyebutton0, '0.5 0.5 0.5', 0.5, 1.0);
  574.     SetThingLight(eyebutton1, '0.5 0.5 0.5', 0.5, 1.0);
  575.     SetThingLight(eyebutton2, '0.5 0.5 0.5', 0.5, 1.0);
  576.  
  577.     Sleep(1.0);
  578.     StartCutscene(1);
  579.     curcam = GetCurrentCamera();
  580.     StopThing(player);
  581.     SetActorFlags(player, 0x200000);
  582.     PlayMode(player, 1, 0);
  583.     
  584.     SetCurrentCamera(2);
  585.     SetCameraFocus(2, cam1);
  586.     SetCameraSecondaryFocus(2, trapdoor);
  587.     SetCollideType(trapdoor, 0);
  588.     Rotate(trapdoor, -90, 0, 1.0);
  589.     PlaySoundThing(grateSnd, trapdoor, 1.0, -1, -1, 0x80);
  590.     trapopen = 1;
  591.     PlayVoice(player, powered, 1.0, 0);
  592.     PlaySoundThing(chargedSnd, charger, 0.5, -1, -1, 0x81);
  593.     Sleep(3.0);
  594.     
  595.     SetCurrentCamera(curcam);
  596.     SetCameraFocus(curcam, player);
  597.     SetCameraFOV(90, 0, 0.0);
  598.     ClearActorFlags(player, 0x200000);
  599.     EndCutScene();
  600.     #Print("That seems to have powered the elevator...!");
  601.     SetCollideType(trapdoor, 3);
  602.     }
  603. # if player activates the charger WITH IMP #4 if elevator is down
  604. if ((GetSenderRef() == charger) && (GetCurFrame(elev) == 0) && (GetParam(1) == 0x4000))
  605.     {
  606.     if (charged == 1) return;
  607.     charged = 1;
  608.     SetCollideType(elev, 3);
  609.     //PlayMode(player, 60, 1);
  610.     PlaySoundThing(charging, eyebutton0, 1.0, -1, -1, 0);
  611.     SetMaterialCel(eyemat, 1);
  612.     SetThingLight(eyebutton0, '0.5 0.5 0.5', 0.5, 1.0);
  613.     SetThingLight(eyebutton1, '0.5 0.5 0.5', 0.5, 1.0);
  614.     SetThingLight(eyebutton2, '0.5 0.5 0.5', 0.5, 1.0);
  615.  
  616.     Sleep(1.0);
  617.     StartCutscene(1);
  618.     curcam = GetCurrentCamera();
  619.     StopThing(player);
  620.     SetActorFlags(player, 0x200000);
  621.     PlayMode(player, 1, 0);
  622.     
  623.     SetCurrentCamera(2);
  624.     SetCameraFocus(2, cam1);
  625.     SetCameraSecondaryFocus(2, trapdoor);
  626.     SetCollideType(trapdoor, 0);
  627.     Rotate(trapdoor, -90, 0, 1.0);
  628.     PlaySoundThing(grateSnd, trapdoor, 1.0, -1, -1, 0x80);
  629.     trapopen = 1;
  630.     PlayVoice(player, powered, 1.0, 0);
  631.     PlaySoundThing(chargedSnd, charger, 0.5, -1, -1, 0x81);
  632.     Sleep(3.0);
  633.     
  634.     SetCurrentCamera(curcam);
  635.     SetCameraFocus(curcam, player);
  636.     SetCameraFOV(90, 0, 0.0);
  637.     ClearActorFlags(player, 0x200000);
  638.     EndCutScene();
  639.     Print("That seems to have powered the elevator...!");
  640.     SetCollideType(trapdoor, 3);
  641.     }
  642.  
  643. #Bridge moves out if button activated with charger
  644. if ((GetSenderRef() == button) && (GetParam(1) == 0x4000) && (bridgeMoving == 0))
  645.     {
  646.         bridgeMoving = 1;
  647.         StopThing(player);
  648.         StartCutscene(1);
  649.         curCam = GetCurrentCamera();
  650.         SetCameraPosInterp(2, 0);
  651.         SetCameraFocus(2, buttonCam);
  652.         SetCameraSecondaryFocus(2, button);
  653.         SetCurrentCamera(2);
  654.         Sleep(1.5);
  655.         SetCameraPosInterp(2, 1);
  656.         SetCameraInterpSpeed(2, 2.0);
  657.         SetCameraFocus(2, bridgeCam);
  658.         SetCameraSecondaryFocus(2, bridge);
  659.         SetCurrentCamera(2);
  660.         SetCameraFOV(90, 0, 0.0);
  661.         SetCameraFOV(60, 1, 2.0);
  662.         MoveToFrame(bridge, (1 - (GetCurFrame(bridge))), 1.0);
  663.         PlaySoundThing(bridgeSlideSnd, bridge, 1.0, 20, 50, 0);
  664.         Sleep(3.5);
  665.         SetCurrentCamera(curCam);
  666.         ResetCameraFOV(0, 0.0);
  667.         EndCutscene();
  668.     }
  669.  
  670.     
  671. #If the player tries to swing when the block isn't in place.
  672. if (getSenderRef() == strut)
  673. {
  674.     if (blockPos == 0) 
  675.     {
  676.         StartCutscene(1);
  677.         SetActorFlags(player, 0x200000);
  678.         PlaySoundLocal(swingAMus, 1.0, 0, 0x0000, 0);
  679.         Sleep(6.0);
  680.         PlaySoundLocal(swingBMus, 1.0, 0, 0x0000, 0);
  681.         #Go to entered message on block
  682.  
  683.         return;
  684.     }
  685.  
  686.     if (blockPos == 1)
  687.     {
  688.         StartCutscene(0);
  689.         curCam = GetCurrentCamera();
  690.         SetCameraLookInterp(2, 0);
  691.         SetCameraPosInterp(2, 0);
  692.         ResetCameraFOV(0, 0.0);
  693.         SetCameraFocus(2, swingCam);
  694.         SetCameraSecondaryFocus(2, swingGhost);
  695.         SetCurrentCamera(2);
  696.         SetCameraFOV(120, 0, 0.0);
  697.         SetCameraFOV(90, 1, 3.0);
  698.         Sleep(3.0);
  699.         SetThingFlags(player, 0x10);
  700.         Sleep(0.5);
  701.         fallActor = CreateThing(actorTPL, fallGhost);
  702.         SetCollideType(fallActor, 0);
  703.         ClearThingFlags(fallActor, 0x80000);
  704.         PlayKey(fallActor, fallKey, 4, 0x1, 0);
  705.         SetCameraFocus(2, fallCam);
  706.         SetCameraSecondaryFocus(2, trapdoor);
  707.         SetCurrentCamera(2);
  708.         Sleep(0.5);
  709.         PlaySoundThing(fallSnd, fallActor, 1.0, -1, -1, 0);
  710.         Sleep(5.0);
  711.         DamageThing(player, 1000, 0x80, weight);
  712.         EndCutscene();
  713.     }
  714.  
  715. }
  716.  
  717. return;
  718.  
  719. # ........................................................................................
  720. end